﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebChat.Services.Models;
using WebChat.Services.PubNubData;

namespace WebChat.Services.Controllers
{
    public class MessageController : ApiController
    {
        [HttpPost]
        [ActionName("post")]
        public HttpResponseMessage PostMessage(MessageModel msg)
        {
            PubNubPushNotifier.PushData(msg.Channel, msg);

            return Request.CreateResponse(HttpStatusCode.OK); // TODO: fix

        }
    }
}
